home *** CD-ROM | disk | FTP | other *** search
- /* *****************************************************************************
- *
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- *
- ***************************************************************************** */
- #include "fast.h"
- #include "event.h"
- #include "device.h"
-
- extern void do_quit(), do_rightmouse(), do_resize(), display(), ShowFast();
- extern void dir_fft(), inv_fft(), add_noise();
- extern void add_box(), this_quit(), this_pow(), this_log();
- extern void size500_500(), size512_512(), size576_405();
-
-
- int mainmenu, quitmenu, sizemenu, realmenu, fouriermenu, fourier2menu;
-
- extern int max_proc;
-
- Init(name)
- char *name;
- {
- prefsize(WIN_SIZE+WIN_RIGHT, WIN_SIZE);
- {
- char *t, *strrchr();
- winopen((t=strrchr(name, '/')) != NULL ? t+1 : name);
- }
-
- wintitle("2D FFT");
-
- add_event(ANY, REDRAW, ANY, display, NULL);
- qdevice(REDRAW);
-
- add_event(ANY, ESCKEY, UP, do_quit, NULL);
- qdevice(ESCKEY);
-
- add_event(ANY, WINQUIT, ANY, do_quit, NULL);
- qdevice(WINQUIT);
-
- add_event(ANY, RIGHTMOUSE, DOWN, do_rightmouse, NULL);
- qdevice(RIGHTMOUSE);
-
- doublebuffer();
- RGBmode();
- gconfig();
-
- cpack(oBLACK);
- clear();
- swapbuffers();
-
- CreateMenus();
-
- do_resize();
- }
-
- char str[64];
- CreateMenus() {
- sizemenu = defpup(" Size %t| 512 x 512 %f| 500 x 500 %f| 576 x 405 %f",
- size512_512, size500_500, size576_405);
- realmenu = defpup(
- "XY Domain %t|Reset %f|Size %m|Add Noise %f|Add BOX %f|------|Direct FFT %f|------|Quit %f",
- do_resize, sizemenu, add_noise, add_box, dir_fft, this_quit);
-
- fouriermenu = defpup(
- "FOURIER Domain %t|Reset %f|Size %m|Power Spectrum%f|Add Noise %f|------|Inverse FFT %f|------|Quit %f",
- do_resize, sizemenu, this_pow, add_noise, inv_fft, this_quit);
-
- mainmenu = realmenu;
-
- quitmenu = defpup("Quit %t|Really %f|Cancel %f",
- do_quit, ShowFast);
- }
-